package com.supervision.manage.mapper

import com.fly.base.mybatis.sqlprovider.SqlProvider
import com.supervision.domain.bean.po.CaseEnforcePO
import com.supervision.domain.bean.vo.CaseEnforceVO
import com.supervision.domain.model.CaseEnforce
import com.supervision.manage.mapper.sqlprovider.CaseEnforceSqlProvider
import org.apache.ibatis.annotations.Mapper
import org.springframework.stereotype.Component
import org.apache.ibatis.annotations.Param
import org.apache.ibatis.annotations.Select
import org.apache.ibatis.annotations.SelectProvider

@Mapper
@Component
interface CaseEnforceMapper {

    @SelectProvider(type = SqlProvider::class, method = "select")
    fun select(@Param("condition") condition: Any, @Param("otherCondition") otherCondition: String?): List<CaseEnforce>

    @SelectProvider(type = CaseEnforceSqlProvider::class, method = "getCaseEnforceList")
    fun getCaseEnforceList(@Param("po") po: CaseEnforcePO, @Param("limitSql") limitSql: String): List<CaseEnforceVO>

    @SelectProvider(type = CaseEnforceSqlProvider::class, method = "getCaseEnforceList")
    fun countCaseEnforceList(@Param("po") po: CaseEnforcePO, @Param("limitSql") limitSql: String): Int

    @Select("""
        select * from case_enforce where id = #{id}
    """)
    fun findById(@Param("id") id: Long): CaseEnforceVO?
}
